//
//  YDHomeReModel.m
//  PeiZiWangBei
//
//  Created by LK-IOS on 2017/11/21.
//  Copyright © 2017年 LK-IOS. All rights reserved.
//

#import "YDHomeReModel.h"


@implementation YDHomeReModel

+ (NSDictionary *)mj_replacedKeyFromPropertyName
{
    return @{
             @"Id" : @"id"
             };
}
//#warning 尚未考虑涨跌为0 的情况
-(NSString *)persentUpDown
{
    if (!self.upDropSpeed) {
        return @"--";
    }else{
        NSString *persentString = [self.upDropSpeed pz_stringNumberByMultiplyingBy:@"100"];
        return [NSString stringWithFormat:@"%@%@",persentString , @"%"];
    }
}

-(PZHomeReModelPriceColor)priceColor
{
    if (!self.upDropSpeed) {
        return Price_Other;
    }else{
        if ([self.upDropSpeed floatValue] >= 0) {
            return Price_Up;
        }else if ([self.upDropSpeed floatValue] == 0.0){
            return Price_Other;
        }else{
            return Price_Down;
        }
    }
}

@end
